import Vue from "vue";
import Router from "vue-router";
import HelloWord from "@/components/HelloWord";
import Cart from "@/components/Cart";
import User from "@/components/User";
import Category from "@/components/Category";
import ProductList from "@/components/ProductList";
import Home from "@/components/Home.vue";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWord,
      children: [{
        path: 'category',
        name: 'category',
        component: Category,
        children: [
          {
            path: ':categoryId',
            name: 'ProductList',
            component: ProductList,
          },

        ]
      },
      {
        path: 'home',
        name: 'home',
        component: Home
      },
      {
        path: 'cart',
        name: 'cart',
        component: Cart
      },
      {
        path: 'user',
        name: 'user',
        component: User
      },
      ]
    },

  ]
});
